--------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\wb614536\Downloads\replication\replication\code\../outputs/08b_LeeBoundsPlot_log.txt
  log type:  text
 opened on:  25 Jun 2026, 13:00:15
r; t=0.00 13:00:15

. 
. include "_OutcomeLabels.do"

. /*==============================================================================
>   _OutcomeLabels.do  (helper, not run on its own)
> 
>   Defines polished, publication-ready labels for every outcome that appears
>   in figures and tables. Labels use the macro pattern `lbl_<outcome>`.
>   Visualization do files `include` this file and reference `lbl_<outcome>`
>   to print a pretty label rather than the raw Stata variable name.
> 
>   Categorical/binary indicators are suffixed with "[=1]" so the reader sees
>   what a unit change means; counts and continuous variables get explicit
>   units; standardized indices are flagged "(SD)".
> 
>   Sandra Rozo
> ==============================================================================*/
. 
. * ---- Economic well-being -----------------------------------------------------
. local lbl_jeea_index_wellbeing  "Well-being index (SD)"
r; t=0.00 13:00:15

. local lbl_labour_income         "Log monthly labor income"
r; t=0.00 13:00:15

. local lbl_gasto_capita          "Log per-capita HH consumption"
r; t=0.00 13:00:15

. local lbl_income_maxhh          "Log HH-max labor income"
r; t=0.00 13:00:15

. local lbl_employed              "Employed [=1]"
r; t=0.00 13:00:15

. 
. * ---- Labor ------------------------------------------------------------------
. local lbl_jeea_index_labor      "Labor index (SD)"
r; t=0.00 13:00:15

. local lbl_formal                "Formal employment [=1]"
r; t=0.00 13:00:15

. local lbl_hora_semana           "Log weekly hours (salaried)"
r; t=0.00 13:00:15

. 
. * ---- Services and rights ----------------------------------------------------
. local lbl_jeea_index_services   "Services index (SD)"
r; t=0.00 13:00:15

. local lbl_sisben                "SISBEN registration [=1]"
r; t=0.00 13:00:15

. local lbl_subs                  "Subsidized health [=1]"
r; t=0.00 13:00:15

. local lbl_bank                  "Savings account [=1]"
r; t=0.00 13:00:15

. local lbl_has_bank_account      "Bank account (incl. savings) [=1]"
r; t=0.00 13:00:15

. local lbl_govtr                 "Govt. transfers [=1]"
r; t=0.00 13:00:15

. 
. * ---- Health -----------------------------------------------------------------
. local lbl_health_pca            "Health PCA index (SD)"
r; t=0.00 13:00:15

. local lbl_anx_depr              "Severe anxiety/depression [=1]"
r; t=0.00 13:00:15

. local lbl_any_anx_depr          "Any anxiety/depression [=1]"
r; t=0.00 13:00:15

. local lbl_vas_score             "Self-rated health (0-100)"
r; t=0.00 13:00:15

. local lbl_phys_problem          "Physical health problem [=1]"
r; t=0.00 13:00:15

. local lbl_chronic_illness       "Chronic illness [=1]"
r; t=0.00 13:00:15

. local lbl_mh_index              "Mental-health composite (SD)"
r; t=0.00 13:00:15

. local lbl_life_satisfaction     "Life satisfaction (0-10)"
r; t=0.00 13:00:15

. local lbl_hi5_inv               "EQ-5D anx/depr (5-low to 1-high)"
r; t=0.00 13:00:15

. 
. * ---- Food security ----------------------------------------------------------
. local lbl_index_food            "Food security index (SD)"
r; t=0.00 13:00:15

. local lbl_skip_meals            "Skipped meals last month [=1]"
r; t=0.00 13:00:15

. local lbl_went_without_food     "Went without food [=1]"
r; t=0.00 13:00:15

. local lbl_protein_days          "Days w/ protein (last week)"
r; t=0.00 13:00:15

. local lbl_food_insecure_seek    "Sought food assistance [=1]"
r; t=0.00 13:00:15

. 
. * ---- Housing ----------------------------------------------------------------
. local lbl_index_housing         "Housing quality index (SD)"
r; t=0.00 13:00:15

. local lbl_adequate_housing      "Adequate housing [=1]"
r; t=0.00 13:00:15

. local lbl_has_electricity       "Has electricity [=1]"
r; t=0.00 13:00:15

. local lbl_has_water             "Has running water [=1]"
r; t=0.00 13:00:15

. local lbl_has_sewage            "Has sewage [=1]"
r; t=0.00 13:00:15

. 
. * ---- Integration ------------------------------------------------------------
. local lbl_index_integration     "Integration index (SD)"
r; t=0.00 13:00:15

. local lbl_belonging             "Sense of belonging (1-4)"
r; t=0.00 13:00:15

. local lbl_feel_integrated       "Feels integrated (1-4)"
r; t=0.00 13:00:15

. local lbl_trust_col             "Trust in Colombians (out-group, 1-5)"
r; t=0.00 13:00:15

. local lbl_trust_ven             "Trust in Venezuelans (in-group, 1-5)"
r; t=0.00 13:00:15

. local lbl_general_trust         "General trust in people (1-5)"
r; t=0.00 13:00:15

. local lbl_venezuelans_help_me   "Venezuelans help me (1-5)"
r; t=0.00 13:00:15

. local lbl_trust_index           "Prosocial behaviors composite (SD)"
r; t=0.00 13:00:15

. local lbl_col_friends           "Number Colombian friends"
r; t=0.00 13:00:15

. local lbl_community_org         "Belongs to community org [=1]"
r; t=0.00 13:00:15

. local lbl_connection_colombia   "Strong connection to Colombia [=1]"
r; t=0.00 13:00:15

. local lbl_colombians_help_me    "Colombians help me (1-5)"
r; t=0.00 13:00:15

. local lbl_count_on_col          "Can count on Colombians (1-5)"
r; t=0.00 13:00:15

. 
. * ---- Discrimination ---------------------------------------------------------
. local lbl_index_discrim         "Discrimination index (SD)"
r; t=0.00 13:00:15

. local lbl_discrim_ever          "Ever discriminated against [=1]"
r; t=0.00 13:00:15

. local lbl_discrim_freq          "Discrimination frequency (1-5)"
r; t=0.00 13:00:15

. local lbl_filed_complaint       "Filed discrimination complaint [=1]"
r; t=0.00 13:00:15

. 
. * ---- Migration intentions ---------------------------------------------------
. local lbl_intend_stay           "Intends to stay in Colombia [=1]"
r; t=0.00 13:00:15

. local lbl_plan_stay_5yr         "Plans to stay 5+ years [=1]"
r; t=0.00 13:00:15

. local lbl_considered_return_ven "Considered returning to Venezuela [=1]"
r; t=0.00 13:00:15

. 
. * ---- COVID -----------------------------------------------------------------
. local lbl_index_covid           "COVID resilience index (SD)"
r; t=0.00 13:00:15

. local lbl_covid_income_down     "Income fell during COVID [=1]"
r; t=0.00 13:00:15

. local lbl_covid_eviction        "Faced eviction during COVID [=1]"
r; t=0.00 13:00:15

. local lbl_covid_received_aid    "Received COVID aid [=1]"
r; t=0.00 13:00:15

. 
. * ---- Education -------------------------------------------------------------
. local lbl_currently_studying    "Currently studying [=1]"
r; t=0.00 13:00:15

. local lbl_currently_enrolled    "Currently enrolled in school [=1]"
r; t=0.00 13:00:15

. local lbl_degree_validated      "Foreign degree validated [=1]"
r; t=0.00 13:00:15

. 
. * ---- Children --------------------------------------------------------------
. local lbl_child_skip_meals      "Child skipped meals [=1]"
r; t=0.00 13:00:15

. local lbl_child_vaccinated      "Child vaccinated [=1]"
r; t=0.00 13:00:15

. local lbl_child_worked          "Child worked [=1]"
r; t=0.00 13:00:15

. 
. * ---- Remittances -----------------------------------------------------------
. local lbl_index_remit           "Remittances index (SD)"
r; t=0.00 13:00:15

. local lbl_remit_now             "Sends remittances now [=1]"
r; t=0.00 13:00:15

. local lbl_remit_to_parents      "Remits to parents [=1]"
r; t=0.00 13:00:15

. 
. * ---- Financial access and digital ------------------------------------------
. local lbl_index_fin_access      "Financial access index (SD)"
r; t=0.00 13:00:15

. local lbl_index_digital         "Digital access index (SD)"
r; t=0.00 13:00:15

. local lbl_has_savings_account   "Has savings account [=1]"
r; t=0.00 13:00:15

. local lbl_has_mobile_money      "Has mobile money [=1]"
r; t=0.00 13:00:15

. local lbl_has_smartphone        "Has smartphone [=1]"
r; t=0.00 13:00:15

. local lbl_has_internet          "Has internet [=1]"
r; t=0.00 13:00:15

. local lbl_apps_whatsapp         "Uses WhatsApp [=1]"
r; t=0.00 13:00:15

. 
. * ============================================================================
. *  PREDETERMINED COVARIATES (used for balance tests and as RD controls)
. * ============================================================================
. 
. * ---- Demographics ----------------------------------------------------------
. local lbl_female                "Female [=1]"
r; t=0.00 13:00:15

. local lbl_age_panel             "Age (years)"
r; t=0.00 13:00:15

. local lbl_yrseduc               "Years of education"
r; t=0.00 13:00:15

. local lbl_time_col              "Years in Colombia"
r; t=0.00 13:00:15

. local lbl_child_venez           "Has child born in Venezuela [=1]"
r; t=0.00 13:00:15

. 
. * ---- Pre-migration economic conditions (in Venezuela) ----------------------
. local lbl_jobopp                "Had a job offer in Colombia [=1]"
r; t=0.00 13:00:15

. local lbl_labven                "Worked in Venezuela [=1]"
r; t=0.00 13:00:15

. local lbl_typeworkven1          "Worked in agric./manual (VZ) [=1]"
r; t=0.00 13:00:15

. local lbl_typeworkven2          "Worked in services (VZ) [=1]"
r; t=0.00 13:00:15

. local lbl_typeworkven3          "Worked in skilled occ. (VZ) [=1]"
r; t=0.00 13:00:15

. local lbl_written_cont          "Had written contract (VZ) [=1]"
r; t=0.00 13:00:15

. local lbl_average               "Avg. days worked / week (VZ)"
r; t=0.00 13:00:15

. local lbl_smartven              "Owned smartphone in VZ [=1]"
r; t=0.00 13:00:15

. local lbl_owner                 "Homeowner in VZ [=1]"
r; t=0.00 13:00:15

. local lbl_electven              "Had electricity in VZ [=1]"
r; t=0.00 13:00:15

. local lbl_waterven              "Had running water in VZ [=1]"
r; t=0.00 13:00:15

. local lbl_sewageven             "Had sewage in VZ [=1]"
r; t=0.00 13:00:15

. 
. * ---- Family / migration network -------------------------------------------
. local lbl_hhven_parents         "Parents born in VZ [=1]"
r; t=0.00 13:00:15

. local lbl_hhven_spouse          "Spouse born in VZ [=1]"
r; t=0.00 13:00:15

. local lbl_hhven_other           "Other HH members born in VZ [=1]"
r; t=0.00 13:00:15

. local lbl_healthmig             "Healthy at migration [=1]"
r; t=0.00 13:00:15

. local lbl_frdfam                "Network in Colombia [=1]"
r; t=0.00 13:00:15

. r; t=0.01 13:00:15

. 
. di "=================================================================="
==================================================================
r; t=0.00 13:00:15

. di "  08b_LeeBoundsPlot.do"
  08b_LeeBoundsPlot.do
r; t=0.00 13:00:15

. di "=================================================================="
==================================================================
r; t=0.00 13:00:15

. 
. /*==============================================================================
>   PART 1: READ LEE BOUNDS RESULTS
> ==============================================================================*/
. 
. import delimited "$out/08_LeeBounds_W2_results.txt", clear delimiter(tab) ///
>     varnames(1) stringcols(1 2)
(encoding automatically selected: ISO-8859-1)
(7 vars, 45 obs)
r; t=0.11 13:00:15

. 
. destring point lower upper trim_q n_eff, replace force
point already numeric; no replace
lower already numeric; no replace
upper already numeric; no replace
trim_q already numeric; no replace
n_eff already numeric; no replace
r; t=0.00 13:00:15

. 
. * Robust to attrition? both bounds same sign as point estimate AND not crossing 0
. gen robust = (lower > 0 & upper > 0) | (lower < 0 & upper < 0) ///
>     if !missing(lower, upper)
r; t=0.00 13:00:15

. 
. di "  Total outcomes: " _N
  Total outcomes: 45
r; t=0.00 13:00:15

. qui count if robust == 1
r; t=0.00 13:00:15

. di "  Robust under Lee bounds: " r(N)
  Robust under Lee bounds: 25
r; t=0.00 13:00:15

. 
. tempfile lee_data
r; t=0.00 13:00:15

. save `lee_data'
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000001.tmp saved as .dta format
r; t=0.00 13:00:15

. 
. /*==============================================================================
>   PART 2: GROUP-BY-THEME LEE BOUND PLOTS
> ==============================================================================*/
. 
. local themes economic services health food integration discrim covid remit fin
r; t=0.00 13:00:15

. 
. local title_economic     "Economic well-being"
r; t=0.00 13:00:15

. local title_services     "Services and rights"
r; t=0.00 13:00:15

. local title_health       "Health"
r; t=0.00 13:00:15

. local title_food         "Food security"
r; t=0.00 13:00:15

. local title_integration  "Integration and trust"
r; t=0.00 13:00:15

. local title_discrim      "Discrimination"
r; t=0.00 13:00:15

. local title_covid        "COVID impacts"
r; t=0.00 13:00:15

. local title_remit        "Remittances"
r; t=0.00 13:00:15

. local title_fin          "Financial access and digital"
r; t=0.00 13:00:15

. 
. local out_economic     jeea_index_wellbeing labour_income gasto_capita income_maxhh employed
r; t=0.00 13:00:15

. local out_services     sisben subs govtr
r; t=0.00 13:00:15

. local out_health       health_pca anx_depr
r; t=0.00 13:00:15

. local out_food         index_food skip_meals went_without_food
r; t=0.00 13:00:15

. local out_integration  index_integration belonging feel_integrated
r; t=0.00 13:00:15

. local out_discrim      index_discrim discrim_ever
r; t=0.00 13:00:15

. local out_covid        index_covid covid_received_aid
r; t=0.00 13:00:15

. local out_remit        index_remit remit_now
r; t=0.00 13:00:15

. local out_fin          index_fin_access index_digital
r; t=0.00 13:00:15

. 
. foreach theme of local themes {
  2.     local title "`title_`theme''"
  3.     local outvars `out_`theme''
  4. 
.     use `lee_data', clear
  5. 
.     * Filter to outcomes in this theme, preserving order
.     gen ord = .
  6.     local ic = 0
  7.     foreach v of local outvars {
  8.         local ++ic
  9.         replace ord = `ic' if outcome == "`v'"
 10.     }
 11.     keep if !missing(ord)
 12.     sort ord
 13. 
.     if _N == 0 {
 14.         di "  No outcomes for theme `theme'; skipping."
 15.         continue
 16.     }
 17. 
.     * Reverse y for top-down ordering
.     gen yorder = _N - _n + 1
 18. 
.     * Two visualization layers:
.     *   - Lee [lower, upper] horizontal bar (thick line)
.     *   - Point estimate marker
.     * Color depends on robustness (green = robust, gray = ambiguous)
.     gen lee_color_str = cond(robust == 1, "forest_green", "gs8")
 19. 
.     local ylabel ""
 20.     forvalues r = 1/`=_N' {
 21.         local nm     = outcome[`r']
 22.         local pos    = _N - `r' + 1
 23.         local pretty "`lbl_`nm''"
 24.         if "`pretty'" == "" local pretty "`nm'"
 25.         local ylabel `"`ylabel' `pos' "`pretty'""'
 26.     }
 27. 
.     * Plot: Lee range (rspike), W2 point (scatter), zero line
.     twoway ///
>         (rspike lower upper yorder if robust == 1, horizontal lcolor(forest_green) lwidth(thick)) ///
>         (rspike lower upper yorder if robust != 1, horizontal lcolor(gs8)          lwidth(medthick) lpattern(dash)
> ) ///
>         (scatter yorder point, msymbol(O) mcolor(black) mfcolor(white) msize(medlarge)) ///
>         , xline(0, lcolor(gs8) lpattern(solid) lwidth(thin)) ///
>           ylabel(`ylabel', labsize(small) angle(0) nogrid notick) ///
>           yscale(noline) ///
>           xlabel(, nogrid notick labsize(small)) ///
>           xscale(noline) ///
>           ytitle("") ///
>           xtitle("Fuzzy RD coefficient (W2)", size(small)) ///
>           legend(order(1 "Lee bounds (robust to attrition)" 2 "Lee bounds (crosses 0)" 3 "W2 point estimate") ///
>                  rows(2) position(6) region(fcolor(white) lcolor(black) lwidth(thin)) size(small)) ///
>           title("Lee bounds: `title' — Wave 2 (2021)", size(medium) color(black)) ///
>           note("Notes: Lee (2009) rank-based trimming bounds at the rdrobust MSE-optimal bandwidth." ///
>                "Each horizontal bar spans [lower, upper]; the open circle marks the W2 point estimate." ///
>                "Solid (navy) bars are robust: both bounds lie on the same side of zero, so the sign" ///
>                "of the effect is preserved under worst-case differential attrition. Dashed (gray)" ///
>                "bars cross zero. Indices labeled '(SD)'; binary outcomes labeled '[=1]'.", ///
>                size(vsmall) color(black) span) ///
>           graphregion(color(white) margin(small)) ///
>           plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>           bgcolor(white) ///
>           name(lee_`theme', replace)
 28. 
.     graph export "$figs/lee_`theme'.png", replace width(1400)
 29.     graph drop lee_`theme'
 30.     di "  lee_`theme'.png saved (`=_N' outcomes)"
 31. }
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(40 observations deleted)
(file ../outputs/figures_leebounds/lee_economic.png not found)
file ../outputs/figures_leebounds/lee_economic.png saved as PNG format
  lee_economic.png saved (5 outcomes)
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(42 observations deleted)
(file ../outputs/figures_leebounds/lee_services.png not found)
file ../outputs/figures_leebounds/lee_services.png saved as PNG format
  lee_services.png saved (3 outcomes)
(45 missing values generated)
(1 real change made)
(1 real change made)
(43 observations deleted)
(file ../outputs/figures_leebounds/lee_health.png not found)
file ../outputs/figures_leebounds/lee_health.png saved as PNG format
  lee_health.png saved (2 outcomes)
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(42 observations deleted)
(file ../outputs/figures_leebounds/lee_food.png not found)
file ../outputs/figures_leebounds/lee_food.png saved as PNG format
  lee_food.png saved (3 outcomes)
(45 missing values generated)
(1 real change made)
(1 real change made)
(1 real change made)
(42 observations deleted)
(file ../outputs/figures_leebounds/lee_integration.png not found)
file ../outputs/figures_leebounds/lee_integration.png saved as PNG format
  lee_integration.png saved (3 outcomes)
(45 missing values generated)
(1 real change made)
(1 real change made)
(43 observations deleted)
(file ../outputs/figures_leebounds/lee_discrim.png not found)
file ../outputs/figures_leebounds/lee_discrim.png saved as PNG format
  lee_discrim.png saved (2 outcomes)
(45 missing values generated)
(1 real change made)
(1 real change made)
(43 observations deleted)
(file ../outputs/figures_leebounds/lee_covid.png not found)
file ../outputs/figures_leebounds/lee_covid.png saved as PNG format
  lee_covid.png saved (2 outcomes)
(45 missing values generated)
(1 real change made)
(1 real change made)
(43 observations deleted)
(file ../outputs/figures_leebounds/lee_remit.png not found)
file ../outputs/figures_leebounds/lee_remit.png saved as PNG format
  lee_remit.png saved (2 outcomes)
(45 missing values generated)
(1 real change made)
(1 real change made)
(43 observations deleted)
(file ../outputs/figures_leebounds/lee_fin.png not found)
file ../outputs/figures_leebounds/lee_fin.png saved as PNG format
  lee_fin.png saved (2 outcomes)
r; t=11.55 13:00:27

. 
. /*==============================================================================
>   PART 3: BUILD PDF
> ==============================================================================*/
. 
. putpdf clear
r; t=0.05 13:00:27

. putpdf begin, pagesize(letter) margin(left, 0.7in) margin(right, 0.7in)
r; t=0.02 13:00:27

. putpdf paragraph, halign(center)
r; t=0.02 13:00:27

. putpdf text ("Lee Bounds Visualization — Wave 2 (2021)"), bold font(, 16)
r; t=0.02 13:00:27

. putpdf paragraph, halign(center)
r; t=0.04 13:00:27

. putpdf text ("Sensitivity of W2 fuzzy-RD effects to differential attrition between waves."), italic
r; t=0.00 13:00:27

. putpdf paragraph, halign(center)
r; t=0.00 13:00:27

. putpdf text ("Generated $S_DATE."), italic font(, 10)
r; t=0.00 13:00:27

. 
. putpdf paragraph
r; t=0.00 13:00:27

. putpdf text ("Reading the plots: each horizontal bar is the Lee (2009) bound interval [lower, upper] obtained by r
> ank-based trimming at the rdrobust MSE-optimal bandwidth. Solid (navy) bars indicate both bounds lie on the same s
> ide of zero, so the sign of the W2 effect is preserved under worst-case differential attrition (robust). Dashed (g
> ray) bars indicate the bounds straddle zero (ambiguous under worst-case selection). The open circle marks the W2 p
> oint estimate. Indices labeled '(SD)' are standardized to the within-wave control mean and SD; binary indicators l
> abeled '[=1]' (so coefficients are percentage-point changes in probability)."), italic font(, 10)
r; t=0.00 13:00:27

. 
. foreach theme of local themes {
  2.     capture confirm file "$figs/lee_`theme'.png"
  3.     if !_rc {
  4.         putpdf paragraph
  5.         putpdf text ("`title_`theme''"), bold font(, 12)
  6.         putpdf paragraph, halign(center)
  7.         putpdf image "$figs/lee_`theme'.png", width(6)
  8.     }
  9. }
r; t=0.12 13:00:27

. 
. putpdf save "$out/08b_LeeBoundsPlot.pdf", replace
successfully created "C:/Users/wb614536/Downloads/replication/replication/outputs/08b_LeeBoundsPlot.pdf"
r; t=0.24 13:00:27

. 
. di ""

r; t=0.00 13:00:27

. di "  PDF saved:  $out/08b_LeeBoundsPlot.pdf"
  PDF saved:  ../outputs/08b_LeeBoundsPlot.pdf
r; t=0.00 13:00:27

. di "  Figures:    $figs/lee_*.png"
  Figures:    ../outputs/figures_leebounds/lee_*.png
r; t=0.00 13:00:27

. di "  Done."
  Done.
r; t=0.00 13:00:27

. 
. log close
      name:  <unnamed>
       log:  C:\Users\wb614536\Downloads\replication\replication\code\../outputs/08b_LeeBoundsPlot_log.txt
  log type:  text
 closed on:  25 Jun 2026, 13:00:27
--------------------------------------------------------------------------------------------------------------------
